package com.wzcl.app.dao.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.wzcl.app.dao.model.common.Base;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;

@Data
@Entity
@Table(name = "SysDictInfo",
        uniqueConstraints = {
                @UniqueConstraint(columnNames = {"keyName", "valueName"}
                )
        }
)
@ApiModel(value = "系统字典值详情")
public class SysDictInfo implements Base {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ApiModelProperty(value = "值")
    private Integer valueName;

    @ApiModelProperty(value = "key")
    private String keyName;

    @ApiModelProperty(value = "描述")
    private String depict;

    @JsonIgnore
    @ManyToOne(cascade = CascadeType.MERGE)
    @JoinColumn(name = "SysDictId")
    private SysDict systemDictionary;
}
